package com.hymall.controller.wx;

import com.fasterxml.jackson.databind.ser.Serializers;
import com.hymall.bean.MarketStorage;
import com.hymall.bean.common.BaseRespVo;
import com.hymall.service.admin.GoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

/**
 * @Author: haiyuny
 * @Date: 2022/7/19 15:01
 * @Description:
 */
@RestController
@RequestMapping("wx/storage")
public class WXStorageController {
    @Autowired
    GoodsService goodsService;
    /**
     * 图片上传
     *
     * @param file
     * @return
     */
    @RequestMapping("upload")
    public BaseRespVo upload(MultipartFile file) {
        MarketStorage pvo = goodsService.create(file);
        return BaseRespVo.ok(pvo);
    }
}
